home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1997
/
HAM Radio 1997.iso
/
vbxs
/
vbslider
/
vcpp
/
sliderdl.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-04-08
|
3KB
|
109 lines
// sliderdl.cpp : implementation file
//
#include "stdafx.h"
#include "vcpptest.h"
#include "sliderdl.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSliderDlg dialog
CSliderDlg::CSliderDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSliderDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSliderDlg)
m_VSlider = NULL;
m_HSlider = NULL;
m_vPos = "";
m_hPos = "";
m_hMax = "";
m_hMin = "";
m_vMax = "";
m_vMin = "";
//}}AFX_DATA_INIT
}
void CSliderDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSliderDlg)
DDX_VBControl(pDX, IDC_VSLIDER1, m_VSlider);
DDX_VBControl(pDX, IDC_HSLIDER1, m_HSlider);
DDX_Text(pDX, IDC_VPOS, m_vPos);
DDX_Text(pDX, IDC_HPOS, m_hPos);
DDX_Text(pDX, IDC_HMAX, m_hMax);
DDX_Text(pDX, IDC_HMIN, m_hMin);
DDX_Text(pDX, IDC_VMAX, m_vMax);
DDX_Text(pDX, IDC_VMIN, m_vMin);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSliderDlg, CDialog)
//{{AFX_MSG_MAP(CSliderDlg)
ON_VBXEVENT(VBN_THUMBPOS, IDC_VSLIDER1, OnThumbposVslider1)
ON_VBXEVENT(VBN_THUMBUP, IDC_VSLIDER1, OnThumbupVslider1)
ON_VBXEVENT(VBN_THUMBPOS, IDC_HSLIDER1, OnThumbposHslider1)
ON_VBXEVENT(VBN_THUMBUP, IDC_HSLIDER1, OnThumbupHslider1)
ON_BN_CLICKED(IDC_SETVALUES, OnSetvalues)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CSliderDlg::OnThumbposVslider1(UINT, int, CWnd*, LPVOID lpParam)
{
char szTemp[10];
short sValue = AFX_NUM_EVENTPARAM(short, lpParam);
wsprintf(szTemp,"%d",sValue);
m_vPos = szTemp;
UpdateData(FALSE);
}
void CSliderDlg::OnThumbupVslider1(UINT uiDummy, int n, CWnd* p, LPVOID lp)
{
OnThumbposVslider1(uiDummy, n, p, lp);
}
void CSliderDlg::OnThumbposHslider1(UINT, int, CWnd*, LPVOID lpParam)
{
char szTemp[10];
short sValue = AFX_NUM_EVENTPARAM(short, lpParam);
long lValue;
lValue = m_HSlider->GetNumProperty("Pos");
wsprintf(szTemp,"%ld",lValue);
m_hPos = szTemp;
UpdateData(FALSE);
}
void CSliderDlg::OnThumbupHslider1(UINT uiDummy, int n, CWnd* p, LPVOID lp)
{
OnThumbposHslider1(uiDummy, n, p, lp);
}
void CSliderDlg::OnSetvalues()
{
long lValue;
UpdateData();
lValue = atol((LPCSTR) m_vMin);
m_VSlider->SetNumProperty("Min", lValue);
lValue = atol((LPCSTR) m_vMax);
m_VSlider->SetNumProperty("Max", lValue);
lValue = atol((LPCSTR) m_hMin);
m_HSlider->SetNumProperty("Min", lValue);
lValue = atol((LPCSTR) m_hMax);
m_HSlider->SetNumProperty("Max", lValue);
}